While working bug #143, it came to my attention that no verbose error is
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 2 Dec 2005 10:08:24 +0000 (11:08 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 2 Dec 2005 10:08:24 +0000 (11:08 +0100)
loged if the dom0 kernel mangles a packet and tries to checksum
offload it.

This should let the user know what is going wrong (instead of silently
dropping the packet).

Signed-off-by: Jon Mason <jdmason@us.ibm.com>
linux-2.6-xen-sparse/net/core/dev.c

index 8c73647ecb2ddd32ba84dd5ae94a971628bd4128..5c59e4ca7972a8dcff3bbb88bae9d2640f54489d 100644 (file)
@@ -1283,6 +1283,11 @@ int dev_queue_xmit(struct sk_buff *skb)
                        skb->csum = offsetof(struct udphdr, check);
                        break;
                default:
+                       if (net_ratelimit())
+                               printk(KERN_ERR "Attempting to checksum a non-"
+                                      "TCP/UDP packet, dropping a protocol"
+                                      " %d packet", skb->nh.iph->protocol);
+                       rc = -EPROTO;
                        goto out_kfree_skb;
                }
                if ((skb->h.raw + skb->csum + 2) > skb->tail)